//
//  YFRecordVideoCell.m
//  Victor
//
//  Created by Coollang on 2017/8/17.
//  Copyright © 2017年 coollang. All rights reserved.
//

#import "YFRecordVideoCell.h"
#import "TrackVideo.h"
#import "UIView+Frame.h"

@interface YFRecordVideoCell ()

@property (nonatomic, weak)IBOutlet UIImageView *videoImg;
@property (nonatomic, weak)IBOutlet UIButton *seleteButton;
@property (weak, nonatomic) IBOutlet UIView *coverview;
@property (nonatomic, strong) TrackVideo *videoItem;

@end

@implementation YFRecordVideoCell

- (void)configuerRecordVideoCell:(TrackVideo *)video isedit:(BOOL)edit {
    self.videoItem = video;
    self.videoImg.image = video.videoImage;
    self.coverview.hidden = !edit;
    self.seleteButton.selected = video.isSelected;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.videoImg.contentMode = UIViewContentModeScaleAspectFill;
    self.videoImg.clipsToBounds = YES;
}

@end


@implementation MTButton


- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.imageView sizeToFit];
    [self.titleLabel sizeToFit];
    
    CGFloat spaceH = (self.height - self.imageView.height - self.titleLabel.height) - 2;
    self.imageView.centerX = self.centerX;
    self.imageView.y = spaceH * 0.45;
    self.titleLabel.centerX = self.centerX;
    self.titleLabel.y = self.height - spaceH * 0.55 - self.titleLabel.height;
}

@end
